package com.demo.cotroller;

import com.alibaba.fastjson.JSONObject;
import com.demo.bean.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author wangzhanjin
 * @date 2018/6/11 14:47
 * 注意Jason在此，此外也有JsonArray处理的
 */
@Controller
@RequestMapping("/fastjson")
public class FastjsonControler {

    /**
     * {"name":"三三","age":18}
     * @param report
     * @return
     */
    @RequestMapping()
    @ResponseBody
    public String hello(String report) {
        Student student = JSONObject.parseObject(report, Student.class);
        return student.toString();
    }
}
